import Axios, { AxiosRequestConfig } from 'axios'

const instance = Axios.create({
  baseURL: window.location.origin,
  timeout: 5000
})

export async function request(url:string,config:AxiosRequestConfig){
  const response = await instance.request({url,...config})
  return response.data
}